﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace W1
{
    public partial class Form8 : Form
    {
        public Form8()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                //非空查询
                string content = textBox1.Text;
                if (content == "")
                {
                    MessageBox.Show("搜索框不能为空");
                    return;
                }
                //学号不存在验证
                //1、sql语句  2、DBHelper调用
                string sql = string.Format("select * from banhui where classID='{0}'", content);
                SqlDataReader dr = DBHelper.GetDataReader(sql);
                while (dr.Read())
                {


                    dr.Close();//关闭读取器
                    return;
                }

            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.Message);
            }
        }

        private void picFanHui_Click(object sender, EventArgs e)
        {
            Form4 form4 = new Form4();
            form4.Show();
            Hide();
        }

        private void Form8_Load(object sender, EventArgs e)
        {

        }
    }
    }

